<?php
use yii\helpers\Url;

$web = Url::base();

$site_name = \app\models\Mall::getCurrentInstitutionSiteName();
$this->title = $site_name . '-物流详情';
?>

<link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall-m/delivery-detail.css"/>

<div class="main">
    <div class="order">
        <ul>
            <?php
            $goods_list = null;
            if ($item != null && $item != '') {
                $goods_list = $item['goods_list'];
                for ($i = 0; $i < count($goods_list); $i++) {
                    ?>
                    <li><a href="javascript:void(0)"><img src="<?= $goods_list[$i]['image_url'] ?>"/></a></li>
                    <?php
                }
            }
            ?>
        </ul>
    </div>
    <div class="state">
        <div class="content">
            <!--            <p class="logistics-state">物流状态 <span>包裹发往调拨中心</span></p>-->
            <p class="source">
                承运来源：<span><?php if ($item != null && $item != '') echo $item['logistics_company']; ?></span></p>
            <p class="number">运单编号：<span><?php if ($item != null && $item != '') echo $item['logistics_code']; ?></span>
            </p>
            <!--            <p class="tell">官方电话：<span>400-860-3111</span></p>-->
        </div>
    </div>
    <div class="tail-after">
        <p class="title">物流跟踪</p>
        <div class="content">
            <?php
            $track_record = null;
            if ($item != null && $item != '') {
                $track_record = $item['track_record'];
                for ($i = 0; $i < count($track_record); $i++) {
                    if($i==0){
                        ?>
                        <div class="message-last">
                            <div class="guide-line-last"></div>
                            <div class="contener">
                                <img class="current-img" src="<?= $web ?>/images/mall-m/logistics-cur-img.png"/>
                                <p class="location"><?= $track_record[$i]->status ?></p>
                                <p class="timer"><?= $track_record[$i]->time ?></p>
                            </div>

                        </div>
                        <?php
                    }
                    if($i>0 && $i<count($track_record)-1) {
                        ?>
                        <div class="message-center">
                            <div class="guide-line-center"></div>
                            <div class="contener">
                                <img class="logistics-img" src="<?= $web ?>/images/mall-m/logistics-img.png"/>
                                <p class="location"><?= $track_record[$i]->status ?></p>
                                <p class="timer"><?= $track_record[$i]->time ?></p>
                            </div>
                        </div>
                        <?php
                    }
                    if($i==count($track_record)-1){
                        ?>
                        <div class="message-first">
                            <div class="guide-line-first"></div>
                            <div class="contener">
                                <img class="logistics-img" src="<?= $web ?>/images/mall-m/logistics-img.png"/>
                                <p class="location"><?= $track_record[$i]->status ?></p>
                                <p class="timer"><?= $track_record[$i]->time ?></p>
                            </div>
                        </div>
                        <?php
                    }
                }
            }
            ?>
        </div>
    </div>
</div>
